package cn.sh.yhk.async;

import cn.sh.yhk.configure.redis.RedisService;
import org.springframework.scheduling.annotation.Async;
import org.springframework.scheduling.annotation.AsyncResult;
import org.springframework.stereotype.Component;

import java.util.concurrent.Future;

/**
 * spring线程池 异步处理事件
 *
 * @Auther: adminyhk
 * @Date: 2018/9/27 13:48
 * @Description:
 */
@Component
public class AsyncTask {

//    @Resource
//    MailUtils mailUtils;

    //  @Resource
    RedisService redisService;

    @Async
    public void sendMessage(String subject, String mailAddress, String content) throws Exception {
        // mailUtils.sendmail(subject, content, mailAddress);
    }

    @Async
    public Future<String> sendMessage() throws Exception {
        return new AsyncResult<>("sas");
    }
}
